from django.contrib.auth.models import Permission
from rest_framework.viewsets import ModelViewSet

from apps.meiduo_admin.serializers.permission import PermissionSerializer, ContentTypeSerializer
from apps.meiduo_admin.utils import PageNum
from django.contrib.auth.models import ContentType
from rest_framework.generics import ListAPIView

class PermissionModelViewSet(ModelViewSet):
    queryset =Permission.objects.all()
    serializer_class = PermissionSerializer
    pagination_class = PageNum


class ContentTypeModelViewSet(ListAPIView):
    queryset = ContentType.objects.all()
    serializer_class = ContentTypeSerializer